#ifndef IMAPTASKTHREAD_H
#define IMAPTASKTHREAD_H

#include <QThread>
#include <QQueue>
#include "imaptask.h"
#include "QtNetwork/QTcpSocket"
#include "imapparsethread.h"

class ImapTaskThread : public QThread
{
public:
    int smtpPort = 25;
    QString smtpServer = "smtp.qq.com";
    int imapPort = 143;
    QString imapServer = "imap.qq.com";
    QString mailAccount = "hmtest1028@qq.com";
    QString user = "hmtest1028";
    QString password = "fxbbpojgpmpvcijj";

    // QString server = "172.16.10.30";
    // QString mailAccount = "ds03@jmtest.cn";
    // QString user = "ds03@jmtest.cn";
    // QString password = "admin123";
    QTcpSocket * mSocket;
    ImapTaskThread(QObject *parent = nullptr);
    void run() override;
    QQueue<ImapTask *> taskQueue = QQueue<ImapTask *>();

    void addTask(ImapTask * task);
    void executeTask(ImapTask * task);
    QString readSocketSync();
    ImapParseThread * parseThread;
};

#endif // SMTPTASKTHREAD_H
